//
//  RootViewController.m
//  UI_随便相册
//
//  Created by dllo on 16/4/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "RootViewController.h"

#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height


@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor blackColor];
    
    for (int i = 0; i < 7; i++) {
        myView *viewX = [[myView alloc]initWithFrame:CGRectMake(WIDTH / 3 * (i % 3), HEIGHT / 3 * (i / 3), WIDTH / 3, HEIGHT / 3)];
        [self.view addSubview:viewX];
        [viewX release];
        
        viewX.myImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"图%d.jpg",i + 1]];
        viewX.myImageView.tag = 100000 + i;
        
        viewX.myDelegate = self;
    }
    
    
}

-(void)viewTocontroller:(NSInteger)tagNum{
    PhotoViewController *pVC = [[PhotoViewController alloc]init];
    pVC.tagNum = tagNum;
    [self presentViewController:pVC animated:YES completion:^{
        
        
    }];
   }
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
